package com.softeem.demo1;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/4/1 10:40
 * @description
 */
public class Student1 {
    private String name;
    private int age;

    public Student1() {
    }

    public Student1(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) throws Myex{
        try {
            if (age>100){
                throw new Myex("age 太大了");
            }else {
                this.age = age;
            }
        } catch (Myex myex) {
            myex.printStackTrace();
        }
    }

}
